{include file='public/meta' }
<title>用户配置 - 木鱼内容管理系统</title>
<style type="text/css">
  .wrap {
    width: 1200px;
    margin: 20px auto;
  }

  .form1 {
    display: flex;
  }

  .addBtn {
    margin-left: 40px;
  }
  .layui-badge {
    height: 28px;
    line-height: 28px;
  }
  .dispalyd{
    display: none;
  }
  .inputSize {
    width:100px;
  }
  .rightDiv {
    margin-left:56%;
    width:40%;
    height:340px;
  }
</style>
</head>
<body>
<div class="wrap">
  <!-- 定义头衔 -->
  <div class="layui-card" style="float:left;width:55%">
    <div class="layui-card-header">前台分页样式(<span style="color:red;">仅限内置分页类写法适用</span>)</div>
    <div class="layui-card-body">
      <div>
        <form class="layui-form" action="">
          <div class="form1">
            <div class="layui-form-item">
              <label class="layui-form-label">DIV层样式</label>
              <div class="layui-input-block">
                <input type="text" name="page_class_index_div" value="{$diy.page_class_index_div}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">按钮激活</label>
              <div class="layui-input-block">
                <input type="n" name="page_class_index_enabled" value="{$diy.page_class_index_enabled}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="form1">
            <div class="layui-form-item">
              <label class="layui-form-label">按钮禁止</label>
              <div class="layui-input-block">
                <input type="text" name="page_class_index_disabled" value="{$diy.page_class_index_disabled}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">省略符号</label>
              <div class="layui-input-block">
                <input type="n" name="page_class_index_out" value="{$diy.page_class_index_out}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="form1">
            <div class="layui-form-item">
              <label class="layui-form-label">每页数量</label>
              <div class="layui-input-block">
                <input type="text" name="page_rows_index" value="{$diy.page_rows_index}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">统计样式</label>
              <div class="layui-input-block">
                <input type="n" name="page_class_index_info" value="{$diy.page_class_index_info}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="form1">
            <div class="layui-form-item">
              <label class="layui-form-label">url别名</label>
              <div class="layui-input-block">
                <input type="text"name="page_var_index" value="{$diy.page_var_index}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">当前分页类</label>
              <div class="layui-input-block">
                <input type="n" name="page_name_index" value="{$diy.page_name_index}" required lay-verify="required"
                       autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="form1">
            <button type="submit" lay-submit lay-filter="tempdiy" id="tempdiy" class="layui-btn addBtn" style="margin-left:40%;">保存</button>
          </div>


        </form>
      </div>
    </div>
  </div>
  <!-- 分页代码渲染示例 -->
  <div class="layui-card rightDiv">
    <div class="layui-card-header">分页代码示例(<span style="color:red;">仅自带分页类最终渲染结果</span>)</div>
    <div class="layui-card-body">
      <pre class="layui-code" lay-title="HTML">
<div class="pagination">//div层
<p class="pageEllipsis">首页</p>//禁止的按钮
<p>上一页</p>
<a href="" class="cur">1</a>//激活的按钮
<p class="pageEllipsis">****</p>//省略符号
<a href="url" title="第" 2"页"="">2</a>
<a href="url" title="尾页">尾页</a>
<p class="pageRemark">共<b>2</b>页<b>2</b>条数据</p>//统计信息
</div>
      </pre>
    </div>
  </div>
</div>
{include file='public/footer' }
<script>
  layui.config({
    base: '__ADMINST__layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['form','layer','code'], function() {
    var $ = layui.$
            , layer = layui.layer
            , form = layui.form;
    layui.code({
      encode: true
    });
    $('#tempdiy').addClass("layui-btn-disabled").attr("disabled",true);//内容改变时才能提交按钮
    $("form").children().change(function(){
      $("#tempdiy").removeClass('layui-btn-disabled').attr("disabled",false);
    });
    form.on('submit(tempdiy)', function (data) {
      ajaxway(data.field, "{:url('admin/Template/tempdiy')}");
      return false;
    });
  })

  function ajaxway(Data,url){
    $.ajax({
      type: 'POST',
      data: Data,
      url: url,
      dataType: "json",
      beforeSend: function() {
        index = layer.load();
      },
      success: function(data) {
        if(data.code === 1){
          layer.msg(data.msg, {time: 2000}, function() {
            location.reload();
          });
        }else{
          layer.msg(data.msg, {time: 2000});
        }
      },
      complete: function() {
        layer.close(index);
      }
    });
  }
</script>
</body>
</html>